export default {
  path: "/movie",
  component: () => import("views/Movie"),
  //搭建子路由 导航栏
  children: [
    {
      path: "city",
      component: () => import("components/Ctiy"),
    },
    {
      path: "nowPlaying",
      component: () => import("components/NowPlaying"),
    },
    {
      path: "comingSoon",
      component: () => import("components/ComingSoon"),
    },
    {
      path: "search",
      component: () => import("components/Search"),
    },
    //正在热映的详情页 defult是默认指定的路由显示  porps传递值
    {
      //要和命名路由的name一一对应
      path: "detail/1/:movieId",
      components: {
        //路由不匹配的时候 就渲染的组件
        default: () => import("components/NowPlaying"),
        // 添加detail  引入渲染的组件
        detail: () => import("views/Movie/detailpage"),
      },
      props: {
        detail: true,
      },
    },
    //即将上的详情页 defult是默认指定的路由显示  porps传递值
    {
      //要和命名路由的name一一对应
      path: "detail/2/:movieId",
      components: {
        //路由不匹配的时候 就渲染的组件
        default: () => import("components/ComingSoon"),
        // 添加detail  引入渲染的组件
        detail: () => import("views/Movie/detailpage"),
      },
      props: {
        detail: true,
      },
    },
    {
      path: "/movie",
      redirect: "/movie/nowPlaying",
    },
  ],
};
